#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int a,b;
    cin >> a >> b;
    int ans = a % 7;
    for (int i = 1; i < b; i++) // b个a
    {
        // pow(a,b) = a*a*a*a*a*.....*a  b个a
        // (a*b)%k = (a%k * b%k) / %k
        ans = (ans%7 * a%7) % 7; 
    }
    if (ans ==0) cout << "Sunday";
    if (ans ==1) cout << "Monday";
    if (ans ==2) cout << "Tuesday";
    if (ans ==3) cout << "Wednesday";
    if (ans ==4) cout << "Thursday";
    if (ans ==5) cout << "Friday";
    if (ans ==6) cout << "Saturday";
    
    return 0;
}